<!DOCTYPE html>
<html>
<head>
	#parse("/common/header.html")
	<link href="#springUrl('/static/js/plugins/gritter/jquery.gritter.css')" rel="stylesheet">
	#block("css")#end
</head>
<body>
<div id="wrapper">
   #parse("/common/nav_left.html")
   <!--右侧部分开始-->
   <div id="page-wrapper" class="gray-bg dashbard-1">
	   <div class="row border-bottom">
	   <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">

	       <ul class="nav navbar-top-links navbar-right">
			   #include('/common/dropdown.html')
	           <li>
	               <a href="#springUrl('/account/login.html')">
	                   <i class="fa fa-sign-out"></i>退出
	               </a>
	           </li>
	       </ul>
	   </nav>
	   </div>

	<div class="row border-bottom white-bg dashboard-header">
		<div class="col-lg-10">
			<h3>  <font color="red">  </font></h3>
			<ol class="breadcrumb">
				<li><a href="index.html">首页</a></li>
				#block("breadcrumb")#end
			</ol>
		</div>
		<div id="messageBtn"></div>
	</div>
	<div class="row">
		<div class="col-lg-12">
			<div class="wrapper wrapper-content">
				#block("content")#end
			</div>
			<!--<div class="footer">

			</div>-->
		</div>
	</div>
   </div>
   <!--右侧部分结束-->
</div>
<script src="#springUrl('/static/js/jquery-2.1.1.js')"></script>
<script src="#springUrl('/static/js/bootstrap.min.js')"></script>
<script src="#springUrl('/static/js/plugins/metisMenu/jquery.metisMenu.js')"></script>
<script src="#springUrl('/static/js/plugins/slimscroll/jquery.slimscroll.min.js')"></script>
<script src="#springUrl('/static/js/plugins/gritter/jquery.gritter.min.js')"></script>
<script src="#springUrl('/static/js/inspinia.js')"></script>
<script src="#springUrl('/static/js/plugins/pace/pace.min.js')"></script>
<script src="#springUrl('/static/js/plugins/gritter/jquery.gritter.min.js')"></script>
<script src="#springUrl('/static/plugins/layer-v2.2/layer/layer.js')"></script>
#include("/common/theme-config.html")
#block("js")#end
</body>
<script type="text/javascript">
	var messageList = JSON.parse('${messageList}');
	if(messageList.length!=0){
        $('#messageBtn').html("<button class='btn btn-danger' onclick='messageRead()' style='float: right'><i class='fa fa-bell'>"+messageList.length+"</i></button>");
	}else {
        $('#messageBtn').html("<button class='btn btn-info' onclick='messageNull()' style='float: right'><i class='fa fa-bell'></i></button>");
	}
	function messageRead() {
	    var msg = "";
		for(i=0;i<messageList.length;i++){
		    msg += "<span style='display: block;color: #8B91A0'>"+messageList[i].message+"</span>";
		}
        layer.open({
            title: '消息'
            ,content: msg
        });
        $('#messageBtn').html("<button class='btn btn-info' onclick='messageNull()' style='float: right'><i class='fa fa-bell'></i></button>");
        $.ajax({
            type: 'POST',
            url: "#springUrl('/message/read')",
            data: $.param({'messageList':JSON.stringify(messageList)}),
            traditional:true,
            success: function (data) {

            },
            dataType: 'json'
        });
    }
    
    function messageNull() {
        layer.open({
            title: '消息'
            ,content: '暂无消息'
        });
    }
	
</script>
</html>